﻿/*********************************************************************************
 *Author:         OnClick
 *Version:        1.0
 *UnityVersion:   2018.3.11f1
 *Date:           2019-04-07
 *Description:    IFramework
 *History:        2018.11--
*********************************************************************************/
namespace IFramework
{
    public class ResAssetPool : ObjectPool<ResAsset>
    {
        public override void Clear()
        {
            using (LockWait wait = new LockWait(ref lockParam))
            {
                while (pool.Count > 0)
                {
                    pool.Dequeue().Dispose();
                }
            }
        }
        public override void Dispose()
        {
            using (LockWait wait = new LockWait(ref lockParam))
            {
                while (pool.Count > 0)
                {
                    pool.Dequeue().Dispose();
                }
                pool = null;
            }
        }
        protected override ResAsset CreatNew()
        {
            return new ResAsset();
        }
    }

}
